<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>绑定卡号</title>
<script src="scripts/jquery-3.3.1.js"></script>
</head>
<style>
	.content{
		margin-top:50px;
		text-align:center;
	}
	table{
		width:500px;
	}
	td{
		padding:20px;
		width:250px;
	}
	.input_text{
		font-size:15px;
		width:250px;
		height:30px;
	}
	#addStu{
		font-size:20px;
		width:100px;
		height:50px;
	}
</style>
<%String path=request.getContextPath(); %>
<body>
<div class="content">
	<div style="display:inline-block;">
	<h2>绑定银行卡</h2>
	<form action="" id="cardinfo">
		<table>
			<tr>
				<td>账号：</td>
				<td><input type="text" class="input_text" name="card" placeholder="请输入卡号" /></td>
			</tr>
			<tr>
				<td>密码：</td>
				<td><input type="text" class="input_text" name="password" placeholder="请输入密码" /></td>
			</tr>
			<tr>
				<td colspan="2"><input type="button" value="绑定" id="addcard" onclick="addCard()"/></td>
			</tr>
		</table>
	</form>
	</div>
</div>
</body>
<script type="text/javascript">
	function addCard(){
		
		$.post("AddCart",$("#cardinfo").serialize(),function(data){
				if(data==1){
					alert("添加成功！");
					location.href="<%=path%>/GetGoodsList?pageNum=1";
				}else{
					alert("添加失败！");
				}
		});
	}
</script>
</html>